package xyz.xiaoshengfu.xrpc.data;

import java.io.Serializable;

/**
 * <p>Title: XRpcData</p>
 * <p>Description: xRPC响应数据包</p>
 * @author xiaoshengfu(2439323118@qq.com)
 * @date 2020年2月25日
 */
public final class XRpcResponseData implements Serializable {

	private static final long serialVersionUID = 1L;

	public static final int OK = 1;
	public static final int TIMEOUT = 2;
	public static final int EXCEPTION = 3;
	public static final int ERROR = 4;
	public static final int AUTH_SUCCESS = 5;
	public static final int AUTH_FAIL = 6;

	private Integer statusCode;
	private Object returnValue;
	private Long requestID;
	private Exception exception;

	public XRpcResponseData() {
		super();
	}

	public XRpcResponseData(Integer statusCode, Long requestID, Exception exception) {
		super();
		this.statusCode = statusCode;
		this.requestID = requestID;
		this.exception = exception;
	}

	public XRpcResponseData(Integer statusCode, Object returnValue, Long requestID, Exception exception) {
		super();
		this.statusCode = statusCode;
		this.returnValue = returnValue;
		this.requestID = requestID;
		this.exception = exception;
	}

	public Integer getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(Integer statusCode) {
		this.statusCode = statusCode;
	}

	public Object getReturnValue() {
		return returnValue;
	}

	public void setReturnValue(Object returnValue) {
		this.returnValue = returnValue;
	}

	public Long getRequestID() {
		return requestID;
	}

	public void setRequestID(Long requestID) {
		this.requestID = requestID;
	}

	public Exception getException() {
		return exception;
	}

	public void setException(Exception exception) {
		this.exception = exception;
	}

	@Override
	public String toString() {
		return "XRpcResponseData [statusCode=" + statusCode + ", returnValue=" + returnValue + ", requestID="
				+ requestID + ", exception=" + exception + "]";
	}

}
